<template>
	<view class="container-schedule">
	  <view v-for="(item,index) in list" class="item" :style="'background-color:'+item.color" :key="index">
	    <view>{{item.title}}</view>
	    <view>{{item.status}}</view>
	  </view>
	</view>
</template>

<script>
	export default{
		data(){
			return {
				list:[]
			}
		},
		onLoad () {
		
		    this.getProgressInfo()
		    this.changedNaviTitle()
		
		  },
		  methods:{
			  getProgressInfo () {
			      
					let school_id = this.$store.getters.currentSchool.school_id
			  
					this.$api.progressInfo({school_id: school_id}).then((res) =>{
						let {data} = res.data
						this.list = data
					})
			    },
			  
			    changedNaviTitle () {
			      var school = this.$store.getters.currentSchool
				  uni.setNavigationBarTitle({
				    title:school.school_name
				  })
			    },
		  }
	}
</script>

<style lang="scss">
	.container-schedule{
	  height: 100%;
	  display: flex;
	  flex-direction: column;
	  align-items: center;
	  justify-content: space-between;
	  box-sizing: border-box;
	  margin-left: 8rpx;
	  margin-right: 8rpx;
	}
	
	.item{
	  display: flex;
	  justify-content: space-between;
	  height: 80rpx;
	  line-height: 80rpx;
	  width: calc(100% - 16rpx);
	  background-color: #529716;
	  border-radius: 2px;
	  margin-top: 20rpx;
	  color: white;
	  font-size: 14px;
	  box-sizing: border-box;
	  padding-left: 20rpx;
	  padding-right: 20rpx;
	}
	
	.item > view:nth-child(2){
	  font-size: 13px;
	}
</style>
